From e1734495d865739a76f23d90258e60c797ead65b Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Tue, 8 Nov 2005 12:16:37 +0100 Subject: [PATCH] After move randomMac to netif in 7637, we need to this for vmx guest. otherwise, if no mac address configured, vmx guest can not be created. Signed-off-by: Xiaofeng Ling --- tools/python/xen/xend/image.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index 0b54e83ca0..6f8231aac7 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -24,6 +24,7 @@ import xen.lowlevel.xc from xen.xend import sxp from xen.xend.XendError import VmError from xen.xend.XendLogging import log +from xen.xend.server.netif import randomMAC xc = xen.lowlevel.xc.new() @@ -276,6 +277,8 @@ class VmxImageHandler(ImageHandler): ret.append("%s" % vbdparam) if name == 'vif': mac = sxp.child_value(info, 'mac') + if mac == None: + mac = randomMAC() ret.append("-macaddr") ret.append("%s" % mac) if name == 'vtpm': -- 2.30.2